cmake_minimum_required(VERSION 3.5)
project(PROJECT_NAME)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)


file(GLOB_RECURSE  project_headers ./src/*.h)
file(GLOB_RECURSE  project_cpps ./src/*.cpp)
file(GLOB_RECURSE  project_cxx ./src/*.cxx)
file(GLOB_RECURSE  project_cc ./src/*.cc)

include_directories(./src/)
set(Qt5_DIR "D:/Qt/Qt5.12.0/5.12.0/msvc2017_64/lib/cmake/Qt5")
find_package(Qt5 COMPONENTS Core Widgets Gui Sql Network Multimedia MultimediaWidgets REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
file(GLOB_RECURSE  project_uis ./src/*.ui)
qt5_wrap_ui(ui_FILES ${project_uis})
file(GLOB  project_res ./src/*.qrc)

# set(TS_FILES
#        ./src/translations/en_US.ts
#        ./src/translations/zh_CN.ts)

find_package(Qt5 COMPONENTS ${REQUIRED_LIBS} LinguistTools REQUIRED)
set(cpp_source_all ${project_headers} ${project_cpps} ${project_cxx} ${project_res} ${project_cc} ${project_c} )
#set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_SOURCE_DIR}/src/translations)
#qt5_create_translation(QM_FILES ${cpp_source_all} ${ui_FILES} ${TS_FILES})
add_executable(PROJECT_NAME ${project_headers} ${project_cpps} ${project_cxx} ${project_cc} ${project_c} 
${project_res}
# ${QM_FILES}
${ui_FILES} )


# target_include_directories(PROJECT_NAME PUBLIC ${SOME_INCLUDES_DIRS})

target_link_libraries(PROJECT_NAME Qt5::Core Qt5::Widgets Qt5::Gui  Qt5::Sql  Qt5::Network Qt5::Multimedia Qt5::MultimediaWidgets)

if(MSVC)
    set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_ENVIRONMENT "path=${Qt5_DIR}/../../../bin/")
endif(MSVC)
